<% javascript "pagination" %>
<% title "Articles" %>


<div id="all_posts_">
  <%= render 'all' %>
</div>

<% if can? :create, Article %>
  <p><%= link_to "New Article", new_article_path %></p>
<% end %>
<script type="text/javascript">
  function doAllPostsAcc()
  {
    //We could not use var for handle div#all_posts because the content, when reloading, change, and the handle is destroyed
    jQuery( 'div#all_posts' ).accordion(
    {
      collapsible: true
    } );
  }
  function init()
  {
    doAllPostsAcc();
  }
  init();
</script>
<br />